<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Dair.Console</title>
<script>
djConfig={
	isDebug:true, 				// true debugs to Console, file or terminal, false, no output
								// To show the console:
								//		isDebug:true
								//			airConfig.terminal:false
								//			airConfig.file:false
	parseOnLoad: true, 
	airConfig:{
		terminal:false,			// logs to terminal window. Does not open Console
		file:false,				// logs to a file. Use options for settings. Does not open Console
		options:{
			path:"documents",			// location of log file. See dair.Log
			folder:"DairLogs/Console",	// folder within user resource. See dair.Log
			name:"Log",					// name of file
			timeStamp:true,				// whether to timeStamp the name of each file
			append:false				// whether to append to one file
										//		if timeStamp:true, creates new file
										//		if timeStamp:false, overwrites files 
		},
		debuggerKey:119,		// the keyCode that opens the Console (doesn't really work)
		introspectorKey:118, 	// the keyCode that opens the Console 
		showTimestamp:false,	// whether to show a timestamp on every line (defaults to false)
		showSender:false		// whether to show the file on every line (defaults to false)
	}
}
</script>
<script src="../js/dojo/dojo.js"></script>

<script>

dojo.require("dair.AIR");
air.trace("test")

var testTrace2 = function(){
	testTrace3();
}
testTrace3 = function(){
	console.trace(5);
}
function testTrace(arg){
	var myArg = "ARG:"+arg;
	var innerFunction = function(){}
	function innerStuff(){}
	testTrace2();
}

console.time("load dom");

dojo.addOnLoad(function(){
	testTrace("foo");return;
	dojo.byId("testDiv").innerHTML = "Console is running.";
	
	console.time("------> write logs");
	console.log("dojo.isAIR", dojo.isAIR)

	console.log("LOG")
	console.info("INFO")
	console.debug("DEBUG")
	console.warn("WARN")
	console.error("ERROR")
	console.dir({
		"console.dir":"test",
		myVar:"myValue",
		myNum:999,
		myArray:[1,2,"a",{o:"object"}]
	});
	console.timeEnd("load dom")
	console.assert(true==1, "true == 1")
	console.assert(true===1, "true === 1")
	console.count("alpha");console.count("alpha");console.count("beta");console.count("beta");
	
	
	
	console.profile()
	console.group()
	console.profileEnd()
	
	
	console.dir(dojo.config)
	
	// testing errors to logfile. doesn't work. -> console.log(aaa+bbb)
	testTrace("foo");
	console.timeEnd("------> write logs");
	
	
	// more tests:
	
	//console.dirxml(document.body)
	//console.dir(air.Capabilities)

	//check syntax and runtime errors:
	//
	//a + c
	//function(}
	
	dojo.byId("testDiv").innerHTML = "Console test is done.";
});
</script>
</head>

<body class="tundra">
<h1>Dair.Console</h1>
<div id="testDiv">Change this text</div>
</body>
</html>
